package Dao.StatisticalReportDao;

import Model.StatisticalReport.Report;
import Model.StatisticalReport.ReportQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ReportBaseDao {

    /**
     * 批量添加
     * @return 添加的记录数量
     */
    int  addBatch(@Param("schema")String schema , @Param("list")List<? extends Report> list);

    /**
     * 查询
     */
    List<? extends Report> select(@Param("schema")String schema ,@Param("query") ReportQuery query);

    /**
     * 计数
     * @return
     */
    int count(@Param("schema")String schema, @Param("query") ReportQuery query);

    /**
     * 查询
     */
    int countAllAnd(@Param("schema") String schema, @Param("query") ReportQuery query);

    Object checkDaaDuplicate(@Param("schema") String schema, @Param("query") ReportQuery query);

    /**
     * 查重
     */
    Object checkSnDuplicate(@Param("schema") String schema, @Param("query") ReportQuery query);

    /**
     * 查询报表数据分布情况
     * @param schema
     * @param year 指定年份
     * @return
     */
    List<Map<String, Object>> selectDistribution(@Param("schema") String schema, @Param("year") int year);
}
